#pragma once

namespace WiiCIS {
	struct WiimoteState {
	private:
		const byte battery;
		const short buttons;

	public:
		WiimoteState() 
			: buttons(0), battery(0) {
		}

		WiimoteState(byte battery, short buttons)
			: battery(battery), buttons(buttons) {
		}

		byte getBattery() const { 
			return battery;
		}

		bool isPressed(Button button) const {
			return (buttons & button) > 0;
		}

		bool isReleased(Button button) const {
			return !isPressed(button);
		}
	};
}